Ext.onReady(function(){ 

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';

var sm = new Ext.grid.CheckboxSelectionModel();
var cm=new Ext.grid.ColumnModel([ 
sm,
new Ext.grid.RowNumberer({header: "编号",width:40}),
{header:'客户编号',dataIndex:'custID',hidden:true},
{header:'客户名称',dataIndex:'custName'},
{header:'客户评级',dataIndex:'systemPDLevel',width:100},
{header:'所属行业',dataIndex:'industryType',width:100},
{header:'所属区域',dataIndex:'area',width:100},
{header:'债项编号',dataIndex:'debtNo',width:100},
{header:'业务品种',dataIndex:'debtType',width:100},
{header:'风险暴露分类',dataIndex:'exposureType',width:100},
{header:'风险暴露余额(元)',dataIndex:'debtBalance',width:100},
{header:'经办人',dataIndex:'operator',width:100},
]); 
var ds=new Ext.data.Store({ 
proxy:new Ext.data.HttpProxy({
url:'RiskReport/listREDetail.do',
method:'POST'
}), 
reader:new Ext.data.JsonReader({ },[
{name:'custID'}, 
{name:'custName'}, 
{name:'systemPDLevel'},
{name:'industryType'},
{name:'area'},
{name:'debtNo'},
{name:'debtType'},
{name:'exposureType'},
{name:'debtBalance'},
{name:'operator'},
]) 
}); 
ds.load(); 



var grid=new Ext.grid.GridPanel({ 
id:'REDetailList',
renderTo:"list", 
stripeRows:true,//斑马线效果
title:"非零售客户风险暴露明细表", 
height:500, 
cm:cm,
store: ds, 
loadMask: { msg: "加载中..." }, 
viewConfig: {   
                            forceFit:true   
            },   
            bbar: new Ext.PagingToolbar({   
                pageSize: 20,   
                store: ds,   
                displayInfo: true,   
                displayMsg: '第{0} 到 {1} 条数据 共{2}条',   
                emptyMsg: "没有数据"   
            }),
            tbar:[
        		{text:'导出excel',handler:exportExcel},
        	] 
});


function exportExcel(){
	window.location.href='RiskReport/exportExcel.do?id=12';
};

})
